package com.xuwang.controller;

import com.xuwang.service.impl.HealthWarningServiceGGImpl;
import com.xuwang.service.impl.RawMaterialSupplierServiceGImpl;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @ClassName WarningController
 * @Description TODO
 * @Author gongzihao
 * @Date 2021/9/22 9:44
 */

@RestController
@Api(value = "WarningController",tags = "预警接口")
@RequestMapping("/warning")
public class WarningController {

    @Resource
    private HealthWarningServiceGGImpl healthWarningGService;
    @Resource
    private RawMaterialSupplierServiceGImpl rawMaterialSupplierGService;


    @GetMapping("/healthWarning")
    public Map<String,Object> HealthWarning(@RequestParam("page") String page ,
                                            @RequestParam("limit") String limit){
        return healthWarningGService.HealthWarning(Integer.parseInt(page),Integer.parseInt(limit));
    }

    @GetMapping("/rawMaterialWarning")
    public Map<String,Object> rawMaterialWarning(String page ,String limit){
        return rawMaterialSupplierGService.earlyWarning(Integer.parseInt(page),Integer.parseInt(limit));
    }
}
